/*************************************************************************
 *
 * $Id: rtc.h 126 2007-02-10 14:57:23Z alpov $
 * 
 *************************************************************************/         

#ifndef _RTC_H
#define _RTC_H

#define DevPCF8583  0b10100000

// mapa RAM pameti obvodu PCF8583
#define PCF_STATUS      0x00
#define PCF_DATETIME    0x02
#define PCF_YEAR        0x10
#define PCF_DF_PTR      0x11
#define PCF_STRUCT_PTR  0x20


extern Mutex RtcMutex;

extern void InitRtc(void);
extern void ReadRtcBlock(char *pointer_ram, unsigned char addr, unsigned char n);
extern void WriteRtcBlock(char *pointer_ram, unsigned char addr, unsigned char n);
extern void WriteRtcStatus(unsigned char status);
extern unsigned long ReadRtc(void);
extern void WriteRtc(unsigned long datetime);

#endif
